<%@ page pageEncoding="utf-8"%> 
<%@page import="com.course.db.*"%>

<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+
		(request.getServerPort() == 80 ? "" : (":"+request.getServerPort())) +path+"/";  
	String   userName   =   (String)session.getAttribute("userName");
	String   userType   =   (String)session.getAttribute("userType");
	String 	 menus=(String)session.getAttribute("menus");
	CourseBasic course = (CourseBasic)session.getAttribute("CourseEdit");
	//session.removeAttribute("CheckCourse");
%>
 
<script type="text/javascript">
	var base_path = "<%=basePath%>";
	var user_name="<%=userName%>";
	var user_type="<%=userType%>";
	var menus="<%=menus%>";
</script>
<base href="<%=basePath%>">
<%
	request.setAttribute("page_title","温岭选课系统-课程申报详细"); 
%>
<link rel="stylesheet" href="css/text.css" />
<link rel="stylesheet" href="css/reset.css" />
<style>
	table{
		margin:0;
		padding:0;
		border-collapse:collapse;
		border:0;
		cellpadding:0;
		cellspacing:0; 
		width:100%;
		//height:100%;
	}
	
	td{
		text-align:center;
		vertical-align:middle;
		line-height:30px;
		font-size:13px;
		border-collapse:collapse;
		border:1px solid black;
		margin:0;
		padding:0;
		
	}

	.tdLeft{
		align:left;
		text-align:left;
		padding-left:20px;
		
	}
</style>

<script type='text/javascript'>
function close(){
	//var comment=document.getElementById("checkComment").value;
	//alert(comment);
	window.close();
	}   
</script>
<script type='text/javascript'>
	function submitcourse()
	{
		var span_v = document.getElementById('course_span').value;
		var credit_v = document.getElementById('credit').value;
		var students_max_v = document.getElementById('students_max').value;
		var students_min_v = document.getElementById('students_min').value;
		
		if(String(parseInt(students_max_v))!== students_max_v || String(parseInt(students_min_v))!== students_min_v)
		{
			alert("限制人数必须为整数!");
			document.getElementById('students_max').focus;
			return false;
		}
		
		if(isNaN(span_v) || isNaN(credit_v))
		{
			alert("总学时数或课程学分不是有效的数字!");
			return false;
		}

	   	document.applyform.submit();
	}
</script>
<div style="width:100%; margin:1px;text-align:center;margin-top:10px;margin-bottom:50px;">
 	<p style="border:0;font-size:14px;padding-bottom:0;">
  		<b>浙江省温岭中学课程申报表</b>
	</p>
	
	<form action="Teacher/editCourse.do?src=edit&type=admin&courseId=<%=course.getId() %>" name="applyform" method="post">
 		<table style="width:80%; margin-left:0%;">
 			<tr>
 				<td>授课教师</td>
 				<td class="tdLeft"><input type="text" size="20" name="teacher_name" value="<%=course.getTeachers() %>"/></td>
 			</tr>
 			<tr>
 				<td>课程分类</td>
 				<td class="tdLeft">
  					<select style="width:160px;" name="course_type">
  					<% %>
 					<% if(course.getType().trim().equalsIgnoreCase("知识拓展")){%>
 						<option value="知识拓展" selected>知识拓展</option>
 					<% }else {%>
 						<option value="知识拓展">知识拓展</option>
 					<% }if(course.getType().trim().equalsIgnoreCase("大学初级课程")){%>
 						<option value="大学初级课程" selected>大学初级课程</option>
 					<% }else {%>
 						<option value="大学初级课程">大学初级课程</option>
 					<%} if(course.getType().trim().equalsIgnoreCase("学科应用")){%>
 						<option value="学科应用" selected>学科应用</option>
 					<%} else {%>
 						<option value="学科应用">学科应用</option>
 					<%} if(course.getType().trim().equalsIgnoreCase("兴趣特长培养")){%>
 						<option value="兴趣特长培养" selected>兴趣特长培养</option>
 					<%} else {%>
 						<option value="兴趣特长培养">兴趣特长培养</option>
 					<%} if(course.getType().trim().equalsIgnoreCase("社会实践活动")){%>
 						<option value="社会实践活动" selected>社会实践活动</option>
 					<%} else {%>
 						<option value="社会实践活动">社会实践活动</option>
 					<%} if(course.getType().trim().equalsIgnoreCase("职业技术培训")){%>
 						<option value="职业技术培训" selected>职业技术培训</option>
 					<%} else {%>
 						<option value="职业技术培训">职业技术培训</option>
 						<%} %>
 					</select>
 				</td>
 			</tr>
 			<tr>
 				<td>课程名称</td>
 				<td class="tdLeft"><input type="text" size="50" name="course_name" value="<%=course.getName() %>"/></td>
 			</tr>
 			<tr>
 				<td>总学时数</td>
 				<td class="tdLeft"><input type="text" size="20" name="course_span" id="course_span" value="<%=course.getCourse_span() %>"/></td>
 			</tr>
 			<tr>
 				<td>课程学分</td>
 				<td class="tdLeft"><input type="text" size="20" name="credit" id="credit" value="<%=course.getCredit() %>"/></td>
 			</tr>
 			<tr>
 				<td>限制人数</td>
 				<td class="tdLeft"><input type="text" size="10" name="students_max" id="students_max" value="<%=course.getStudents_high() %>"/>/<input type="text" size="10" name="students_min" id="students_min" value="<%=course.getStudents_low() %>"/> (最多/最少)</td>
 			</tr>
 			<tr>
 				<td>开课时间</td>
 				<td class="tdLeft">
 					<select style="width:80px;" name="year">
 						<option value="2012年">2012年</option>
 						<option value="2013年">2013年</option>
 						<option value="2014年">2014年</option>
 					</select>&nbsp;&nbsp;&nbsp;&nbsp;
 					<% if(course.getOpenterm().trim().equalsIgnoreCase("第一学期")){%>
 						<input type="checkbox" name="term" value="第一学期" checked=true/>第一学期&nbsp;&nbsp;
 					<% }else {%>
 						<input type="checkbox" name="term" value="第一学期"/>第一学期&nbsp;&nbsp;
 					<% }if(course.getOpenterm().trim().equalsIgnoreCase("第二学期")){%>
 						<input type="checkbox" name="term" value="第二学期" checked=true/>第二学期&nbsp;&nbsp;
 					<% }else {%>
 						<input type="checkbox" name="term" value="第二学期"/>第二学期&nbsp;&nbsp;
 					<% }if(course.getOpenterm().trim().equalsIgnoreCase("第三学期")){%>
 						<input type="checkbox" name="term" value="第三学期" checked=true/>第三学期&nbsp;&nbsp;
 					<% }else {%>
 						<input type="checkbox" name="term" value="第三学期"/>第三学期&nbsp;&nbsp;
 					<%} if(course.getOpenterm().trim().equalsIgnoreCase("第四学期")){%>
 						<input type="checkbox" name="term" value=第四学期 checked=true/>第四学期&nbsp;&nbsp;
 					<%} else {%>
 						<input type="checkbox" name="term" value="第四学期"/>第四学期&nbsp;&nbsp;
 						<%} %>
 				</td>
 			</tr>
 			<tr>
 				<td>面向年级</td>
 				<td class="tdLeft">
 					<% if(course.getGrade().trim().equalsIgnoreCase("高一年级")){%>
 						<input type="checkbox" name="grade" value="高一年级" checked=true/>高一年级&nbsp;&nbsp;
 					<% }else {%>
 						<input type="checkbox" name="grade" value="高一年级"/>高一年级&nbsp;&nbsp;
 					<% }if(course.getGrade().trim().equalsIgnoreCase("高二年级")){%>
 						<input type="checkbox" name="grade" value="高二年级" checked=true/>高二年级&nbsp;&nbsp;
 					<% }else {%>
 						<input type="checkbox" name="grade" value="高二年级"/>高二年级&nbsp;&nbsp;
 					<%} if(course.getGrade().trim().equalsIgnoreCase("高三年级")){%>
 						<input type="checkbox" name="grade" value=高三年级 checked=true/>高三年级&nbsp;&nbsp;
 					<%} else {%>
 						<input type="checkbox" name="grade" value="高三年级"/>高三年级&nbsp;&nbsp;
 						<%} %>
 				</td>
 			</tr>
 			<tr>
 				<td>上课时间</td>
 				<td class="tdLeft"><input type="text" size="50" name="time"  value="<%=course.getTeach_time() %>"/></td>
 			</tr>
 			<tr>
 				<td>上课地点</td>
 				<td class="tdLeft"><input type="text" size="50" name="location" value="<%=course.getTeach_location() %>"/></td>
 			</tr>
 			<tr>
 				<td>教学方式</td>
 				<td class="tdLeft"><input type="text" size="50" name="teach_style" value="<%=course.getTeach_style() %>"/></td>
 			</tr>
 			<tr>
 				<td>考核方式</td>
 				<td class="tdLeft">
 				<!-- <input type="text" size="50" name="test_style" value="<%=course.getTest_style() %>"/> -->
 				<select style="width:80px;" name="test_style">
 						<%if(course.getTest_style().equals("分数制")){ %>
 						<option value="分数制" selected>分数制</option>
 						<%}else{ %>
 						<option value="分数制" >分数制</option>
 						<%}if(course.getTest_style().equals("等级制")){ %>
 						<option value="等级制" selected>等级制</option>
 						<%}else{ %>
 						<option value="等级制" >等级制</option>
 						<%}if(course.getTest_style().equals("其它")){ %>
 						<option value="其它" selected>其它</option>
 						<%}else{ %>
 						<option value="其它" >其它</option>
 						<%} %>
 				</select>
 				</td>
 			</tr>
 			<tr>
 				<td>课程简介</td>
 				<td class="tdLeft"><textarea cols=50 rows=2 name="equipments"  style="margin-top:5px;margin-bottom:5px;"><%=course.getTeach_equipments() %></textarea></td>
 			</tr>
 			<tr>
 				<td>教学所属设备</td>
 				<td class="tdLeft"><textarea cols=50 rows=2 name="introduction"  style="margin-top:5px;margin-bottom:5px;"><%=course.getIntroduction() %></textarea></td>
 			</tr>
 		</table>
		<div id="btn" style="width:100%;align:right">
			
			<input type="reset" name="Reset" value="重置"  style="margin-left:58%;"/>&nbsp;&nbsp;&nbsp;&nbsp;
      		<input type="button" name="Submit" value="提交" onclick="javascript:submitcourse()" />
		</div>
		</form>

</div>